home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-15 | 24.2 KB | 677 lines | [TEXT/KAHL] |
- //
- // These constants are used to turn on the good code (i.e. the non-buggy code)
- //
- #define kFixCallNewInkFirst // fix the uninitialized gxInk problem
- #define kFixMoveScaleRotate // fix the moving, scaling, and rotation into outer space problems
- #define kFixTextSize // fix the text too small (i.e. using ints instead of fixed #'s) problem
- #define kFixOutliningOfText // fix the outlining of the text to run along the character's geometry
- #define kAddPatternToRectangle // defining this flag calls the function which adds the pattern to the rectangle
- //#define kDrawBitmapPattern
- #define kFixPatternRotationFill // fix the funky bitmap rotation patterning problem...
- #define kDisposeTheCopyOfRectangleShape // dispose of the rectangle shape we copied into the picture
-
- /**
- --
- -- App: QDGX Debugging (WWDC'94)
- --
- --
- -- Version: 1.0 4/94: added all of the calls required to support the "Using QuickDraw™ GX
- -- In QuickDraw Applications & Debugging Tips" session at the WWDC '94
- --
- -- 4/96 bob Updated #includes to support changed GX Library names.
- -- Updated the note regarding the files needed to run.
- -- Updated the copyright date.
- --
- -- File: QDGX Debugging (WWDC'94).c
- --
- --
- -- Comments: This code creates a picture shape which contains the following shapes:
- --
- -- - "G" and "X" as text shapes using the Skia font in 128 points, using a CMYK color,
- -- and an ADD transfer mode to allow color blending when shapes overlap.
- --
- -- - two path shapes: one to outline the "G" and the other to outline the "X",
- -- which are draw as closed frame filled paths.
- --
- -- - a rectangle shape in a light gray CMYK color
- --
- -- As we create the shapes mentioned above, they are added to the picture
- -- shape - gThePage. We will then move this picture shape to the center of
- -- the window, scale it 3x, and rotate 15 degrees.
- --
- -- Finally, we add a 15 degree rotated bitmap as a pattern to the rectangle. This may
- -- seem straight forward, but the rotation of the bitmap shape causes some interesting
- -- problems and difficulties. See the comments with the "AddPatternedRectToPicture"
- -- function for complete details of these issues.
- --
- -- This is the same code which was used during the"Using QuickDraw™ GX
- -- In QuickDraw Applications & Debugging Tips" session at the WWDC '94
- --
- -- During our talk ay the WWDC '94, we demonstrated various bugs and debugging
- -- techniques. All of the "bugs" are controlled by the #defines below. If you want to see
- -- a particular bug, comment out the particular #define. There are comments regarding each
- -- #define below.
- --
- -- You can search on "BUG", to find all of the location we introduced a problem and a comment
- -- describing each fix...
- --
- -- Also, you will need to install the "GXGraphics(debug)" extension to see and understand
- -- all of the bugs. This extension also prevents a "bus error" from a bug within our code
- -- which GX validation will catch (if you are running the debugging extension).
- --
- -- To receive the cool graphics effects, you need the following font installed into
- -- your system: Skia (this font will be automatically installed, if you use the Installer Script)
- --
- --
- -- Components: QDGX Debugging (WWDC'94).c
- -- graphics shell.c
- -- graphics shell.h
- --
- -- QDGX Debugging (WWDC'94).c contains all of the QuickDraw GX calls to draw and
- -- manipulate shapes. All of the interesting QuickDraw GX calls occur within this file.
- -- This file also contains the following function calls to make the graphics shell.c run
- -- correctly: DoInitialization, DoDraw, DoClick, DoDispose, DoIdle.
- --
- -- graphics shell.c contains the event loop and all of the calls to initialize QuickDraw GX.
- --
- --
- -- QuickDraw GX
- -- Libraries
- -- Used: This application uses the following QuickDraw GX library code files:
- -- "ColorLibrary.c", "FontLibrary.c", "GraphicsDebugLibrary.c", "QDLibrary.c",
- -- "TransferModeLibrary.c", and "TransformLibrary.c".
- --
- --
- -- Notes: 1) Print this file in landscape for the best results
- --
- -- 2) If you are using THINK C v6.x, I have added THINK markers to navigate the code.
- --
- -- 3) All of the functions are ordered in the order (top of this file to the bottom) they are called.
- --
- --
- -- Authors: Pete "Luke" Alexander and Herb Derby
- -- Developer Technical Support QuickDraw GX Engineer
- -- AppleLink: DEVSUPPORT
- --
- --
- -- ©1992 - 1996 Apple Computer, Inc.
- -- All rights reserved.
- --
- **/
-
- #include <events.h>
- #include <windows.h>
-
- #include "GraphicsLibraries.h"
- #include "QDLibrary.h"
- #include "FontLibrary.h"
- #include <GXEnvironment.h>
- #include <GXErrors.h>
- #include "graphics shell.h"
-
-
- //
- // Prototypes used _only_ within this file
- //
- void AddARectToPicture ( void );
- void ColorTheRectInPicture ( void );
- void ScaleAndRotateRectInPicture ( void );
- void AddTextToPicture ( void );
- void InitColorMatrix( Fixed xferModeMatrix[5][4] );
- void AddTransferModeToShape ( gxShape shapeWantingXferMode );
- void AddPatternedRectToPicture ( void );
-
-
- //
- // Set up the title and size of the window
- //
- Str255 gWindowTitle = "\p QuickDraw™ GX Debugging - WWDC '94 ";
- Rect gWindowQDRect = {50, 10, 475, 575};
-
-
- //
- // gGraphicsHeapSize sets the size of the graphics heap created by calling the NewGraphicsClient routine
- // in main () within graphics shell.c. You can determine the amount of graphics heap required by using GraphicsBug.
- // With gGraphicsHeapSize set to 65k, I had 8 free blocks left in the QuickDraw GX heap. When I tried to
- // use a 65k, I received the disposed_dead_caches notice. This tells us the GX required additional memory to
- // complete an operation, therefore it needed to toss away outdated caches to complete the task. This is not necesarily
- // bad, but an additional 8k solved this problem and prevented the disposing....
- //
- long gGraphicsHeapSize = 72;
-
- gxShape gThePage; // the picture shape containing all of shapes created and drawn
-
-
-
- /*------ DoInitialization ---------------------------------------------------------------------------------*/
- //
- // This function creates the picture we want to add 5 shapes to and makes the appropriate function calls to
- // create them.
- //
- void DoInitialization(theWindow)
- WindowPtr theWindow;
- {
- //
- // Create an empty picture shape to hold all of our shapes. After creating the picture shape, we can add
- // shapes at will....
- //
- gThePage = GXNewShape (gxPictureType);
-
- AddTextToPicture ( );
- AddARectToPicture ( );
- ColorTheRectInPicture ( );
- ScaleAndRotateRectInPicture ( );
-
- #ifdef kAddPatternToRectangle
- AddPatternedRectToPicture ( );
- #endif
- }
-
-
- /*------ InitColorMatrix --------------------------------------------------------------------------------*/
- //
- // This function takes the matrix passed in and sets it to the identity. It was taken from the "transferMode libray.c".
- //
- void InitColorMatrix(Fixed xferModeMatrix[5][4])
- {
- register Fixed *x;
- register int loop;
-
- x = &xferModeMatrix[0][0];
-
- //
- // Initialize the matrix passed in to be filled full of 0's
- //
- for(loop = 19; loop >=0; loop--)
- *x++ = 0;
-
- //
- // Add the identity matrix, for cleanliness
- //
- xferModeMatrix[0][0] = xferModeMatrix[1][1] = xferModeMatrix[2][2] = xferModeMatrix[3][3] = fixed1;
- }
-
-
- /*------ AddTransferModeToShape -----------------------------------------------------------------------*/
- //
- // This function creates an Add transfer mode.
- //
- void AddTransferModeToShape ( shapeWantingXferMode )
- gxShape shapeWantingXferMode;
- {
- gxTransferMode newAddTransferMode;
- int loop;
-
- newAddTransferMode.space = gxCMYKSpace;
- newAddTransferMode.flags = 0;
- newAddTransferMode.set = nil;
- newAddTransferMode.profile = nil;
-
- //
- // Set each component of the transfer mode..
- //
- for ( loop = 0; loop < 4; loop++ )
- {
- newAddTransferMode.component[ loop ].mode = gxAddMode;
- newAddTransferMode.component[ loop ].flags = 0;
-
- newAddTransferMode.component[ loop ].operand = 0x8000;
-
- newAddTransferMode.component[ loop ].sourceMinimum = 0;
- newAddTransferMode.component[ loop ].sourceMaximum = 65535;
-
- newAddTransferMode.component[ loop ].deviceMinimum = 0;
- newAddTransferMode.component[ loop ].deviceMaximum = 65535;
-
- newAddTransferMode.component[ loop ].clampMinimum = 0;
- newAddTransferMode.component[ loop ].clampMaximum = 65535;
-
- }
-
- //
- // Initialize each matrix used within the transfer mode to contain the identity matrix
- //
- InitColorMatrix( newAddTransferMode.sourceMatrix );
- InitColorMatrix( newAddTransferMode.deviceMatrix );
- InitColorMatrix( newAddTransferMode.resultMatrix );
-
- GXSetShapeTransfer( shapeWantingXferMode, &newAddTransferMode );
- }
-
-
- /*------ AddTextToPicture ------------------------------------------------------------------------------*/
- //
- // This function creates the "G" and "X" text shapes and the paths which outline each. The "G" and "X" text shapes
- // are colored in a CMYK color using the Add transfer mode and the Skia Regular font (with it's bold axis set to it's
- // maximum). The Skia font is a new TrueType GX variation font. The outlines of the "G" and "X" text shapes are closed
- // frame filled paths colored in back with the copy transfer mode.
- //
- void AddTextToPicture ( )
- {
- gxStyle textStyle = GXNewStyle();
- gxFont theSkiaFont;
- Fixed maxVariationValue;
- gxFontVariation fontVariation;
- long result;
- gxColor textColor, blackTextColor;
- gxShape textShape, tempTextShape;
- gxPoint textLocation = { ff(0), ff(0) };
-
- //
- // Create a new style to contain: the font, font size, the 'wght' axis of the font set to the
- // maximum value allowed for this font, set the pen size, and the location of the pen when
- // drawing.
- //
- GXSetStylePen( textStyle, ff(2) );
-
- //
- // Here's a BUG, all numbers which are used as a parameter to a GX function must be in
- // in fixed point. Otherwise, you will receive very, very, very, small numbers when ints are passed in.
- // The "ff" macro calls the IntToFixed (...) function.
- //
- #ifdef kFixTextSize
- GXSetStyleTextSize( textStyle, ff(128) );
- #else
- GXSetStyleTextSize( textStyle, 128 );
- #endif
-
- //
- // Create a GX font using the Skia regular font...
- //
- theSkiaFont = FindPNameFont ( gxFullFontName, "\pSkia Regular" );
- GXSetStyleFont( textStyle, theSkiaFont );
-
- //
- // Here's a BUG (or unwanted behavior), since we are scaling and rotating our picture, we want to
- // turn "off" all of the metrics and hinting used by TrueType GX while it draws. If you do not turn them
- // off for the text, the outline for each character will not line up (i.e. scale linearly) correctly.
- //
- #ifdef kFixOutliningOfText
- GXSetStyleTextAttributes( textStyle, gxNoMetricsGridText | gxNoContourGridText );
- #endif
-
- //
- // If the "result" is good, we proceed to set the "wght" axis to the maximum value. If the
- // "result" is bad, this probably means that the "Skia" font has not been installed. In this
- // case we cannot set the "wght" axis, so we do not and we alert the user. We will be able
- // to continue at this point, but we will not have the fat juicy letters.
- //
- result = GXFindFontVariation( theSkiaFont, 'wght', nil, nil, &maxVariationValue, nil );
-
- if (result) {
- fontVariation.name = 'wght';
- fontVariation.value = maxVariationValue;
-
- GXSetStyleFontVariations( textStyle, 1, &fontVariation );
-
- } else DebugStr ("\p NO 'wght' axis....");
-
- //
- // Set up as CMYK color space which will used to color all of our text shapes. The "G" will
- // be colored in magenta. Each text shape will use a different CMYK color. We change the setting
- // for our "textColor" when we create each new shape.
- //
- textColor.space = gxCMYKSpace;
- textColor.element.cmyk.cyan = 0x0000;
- textColor.element.cmyk.magenta = 0xffff;
- textColor.element.cmyk.yellow = 0x0000;
- textColor.element.cmyk.black = 0x0000;
- textColor.profile = nil;
-
- //
- // Create the "G", and set it's: style, transfer mode, color, and shape fill. Once created, add it to
- // the end of our picture....
- //
- textShape = GXNewText (1, (unsigned char*) "G", &textLocation );
- GXSetShapeStyle( textShape, textStyle );
- GXSetShapeColor( textShape, &textColor );
- AddTransferModeToShape ( textShape ); // This function is defined above to add the transfer mode to the "G"
-
- GXSetPictureParts( gThePage, 0, 0, 1, &textShape, nil, nil, nil );
-
- //
- // We create a unique copy of our "G" and convert it into a path shape to outline the "G". This outline will
- // be in black using a copy transfer mode. We set the transfer mode to copy to prevent the printing system from
- // performing unneeded work...
- //
- tempTextShape = GXCopyToShape ( nil, textShape );
- GXSetShapeType( tempTextShape, gxPathType );
- GXSetShapeFill( tempTextShape, gxClosedFrameFill );
-
- blackTextColor.space = gxCMYKSpace;
- blackTextColor.element.cmyk.cyan = 0x0000;
- blackTextColor.element.cmyk.magenta = 0x0000;
- blackTextColor.element.cmyk.yellow = 0x0000;
- blackTextColor.element.cmyk.black = 0xffff;
- blackTextColor.profile = nil;
-
- SetShapeCommonTransfer (tempTextShape, gxCopyMode );
-
- GXSetShapeColor( tempTextShape, &blackTextColor );
- GXSetPictureParts( gThePage, 0, 0, 1, &tempTextShape, nil, nil, nil );
-
- GXDisposeShape( tempTextShape );
- GXDisposeShape( textShape );
-
- //
- // Set the CYMK color to be cyan.
- //
- textColor.element.cmyk.magenta = 0x0000;
- textColor.element.cmyk.cyan = 0xffff;
-
- //
- // Create the "X" text shape, set it's transfer mode to gxAddMode by calling our AddTransferModeToShape function,
- // and set it's starting location, set the color, attach the style, and set the shape fill.
- //
- textLocation.x += ff( 60 );
- textShape = GXNewText ( 1, (unsigned char*) "X", &textLocation );
- GXSetShapeStyle( textShape, textStyle );
- GXSetShapeColor( textShape, &textColor );
- AddTransferModeToShape ( textShape );
-
- GXSetPictureParts( gThePage, 0, 0, 1, &textShape, nil, nil, nil );
-
- tempTextShape = GXCopyToShape ( nil, textShape );
-
- //
- // Create the outline of the "X". We convert our "X" text shape to a path, color it black, and set the fill to be
- // closed frame.
- //
- GXSetShapeType( tempTextShape, gxPathType );
- GXSetShapeFill( tempTextShape, gxClosedFrameFill ) ;
- GXSetShapeColor( tempTextShape, &blackTextColor );
- SetShapeCommonTransfer (tempTextShape, gxCopyMode );
-
- GXSetPictureParts( gThePage, 0, 0, 1, &tempTextShape, nil, nil, nil );
-
- //
- // Dispose of the shapes and styles which are no longer needed. All of this information is now contained
- // within our picture shape - gThePage.
- //
- GXDisposeShape( tempTextShape );
- GXDisposeShape( textShape );
- GXDisposeStyle( textStyle );
- }
-
-
- /*------ AddARectToPicture -----------------------------------------------------------------------------*/
- //
- // This function adds the background rectangle to our picture shape. We add this shape to the
- // beginning of the picture.
- //
- void AddARectToPicture ( )
- {
- gxShape tempRectShape;
- gxRectangle pictureBounds;
-
- //
- // Get the bounds of the picture shape. At this point, it contains 4 shapes (2 text & 2 paths). The
- // bounding box will encompass the area required to draw all of the shapes created at this point.
- // We will then inset the shape to provide better visual effects and color mixing.
- //
- GXGetShapeBounds( gThePage, 0, &pictureBounds );
-
- tempRectShape = GXNewRectangle( &pictureBounds );
- GXInsetShape( tempRectShape, ff(10) );
-
- GXSetPictureParts( gThePage, 1, 0, 1, &tempRectShape, nil, nil, nil );
-
- GXDisposeShape( tempRectShape );
- }
-
-
- /*------ ColorTheRectInPicture --------------------------------------------------------------------------*/
- //
- // This function changes the color of your rectangle to be a light gray CMYK colored rectangle.
- //
- void ColorTheRectInPicture ( )
- {
- gxColor cmykColor;
- //
- // Here's the BUG, you MUST call GXNew___ before using any GX object. If you have the "GXGraphics(debug)"
- // extension installed and validation turned on, you will receive a validation error, if you try to use an
- // uninitialized GX object. Otherwise, you will bus error...
- //
- #ifdef kFixCallNewInkFirst
- gxInk grayCMYKInk = GXNewInk ();
- #else
- gxInk grayCMYKInk;
- #endif
- gxShape rectShapeFromPicture;
-
- //
- // Create the light gray CMYK color
- //
- cmykColor.space = gxCMYKSpace;
- cmykColor.element.cmyk.cyan = 0x0000;
- cmykColor.element.cmyk.magenta = 0x0000;
- cmykColor.element.cmyk.yellow = 0x0000;
- cmykColor.element.cmyk.black = 0x7000;
- cmykColor.profile = nil; // by passing nil, tells GX to not color match a shape
- // using this ink (color)...
-
- GXSetInkColor( grayCMYKInk, &cmykColor );
-
- GXGetPictureParts( gThePage, 1, 1, &rectShapeFromPicture, nil, nil, nil );
-
- GXSetShapeInk( rectShapeFromPicture, grayCMYKInk );
-
- GXDisposeInk ( grayCMYKInk );
- }
-
-
- /*------ ScaleAndRotateRectInPicture --------------------------------------------------------------------*/
- //
- // This function moves our picture shape into the center of the window, scales it by 3, and rotates it (-15) degrees.
- //
- // These macros are used within the function to determine the width and height of our picture and window.
- //
- #define width( r ) ((r).right - (r).left)
- #define height( r ) ((r).bottom - (r).top)
-
- void ScaleAndRotateRectInPicture ( )
- {
- gxRectangle pictureBounds;
- gxRectangle windowBounds;
- gxPoint theCenter;
- gxPoint theTopLeft;
-
- GXGetShapeBounds( gWindowBoundsShape, 0, &windowBounds );
- GXGetShapeBounds( gThePage, 0, &pictureBounds );
-
- //
- // Determine the center of the window
- //
- theCenter.x = width( windowBounds ) >> 1;
- theCenter.y = height( windowBounds ) >> 1;
-
- //
- // Determine the top left corner were we should place our picture shape to be in the center of the window
- //
- theTopLeft.x = theCenter.x - ( width( pictureBounds) >> 1 );
- theTopLeft.y = theCenter.y + ( height( pictureBounds) >> 1 );
-
- //
- // Here's the BUG, you MUST move the shape before we scale and rotate it to prevent it from
- // being transformed into outer space....
- //
- #ifdef kFixMoveScaleRotate
- GXMoveShape( gThePage, theTopLeft.x, theTopLeft.y );
- GXScaleShape( gThePage, ff(3), ff(3), theCenter.x, theCenter.y);
- GXRotateShape( gThePage, -ff(15), theCenter.x, theCenter.y );
- #else
- GXScaleShape( gThePage, ff(3), ff(3), theCenter.x, theCenter.y);
- GXRotateShape( gThePage, -ff(15), theCenter.x, theCenter.y );
- GXMoveShape( gThePage, theTopLeft.x, theTopLeft.y );
- #endif
- }
-
-
-
- /*------ AddPatternedRectToPicture ---------------------------------------------------------------------*/
- //
- // This function adds a bitmap shape as a pattern to our rectangle. The bitmap shape is rotated 45 degrees. This
- // rotation causes an interesting problem which is described below.
- //
- void AddPatternedRectToPicture ( )
- {
- gxShape dogcowBitmapShape,
- tempRectShape ,
- rectShapeFromPicture,
- newBitmapClipShape;
- gxRectangle patternBounds;
- gxPatternRecord thePattern;
- gxPolar toRotate;
- gxTransform transformFromPicture, invertedTransform;
- gxMapping theMapping;
-
- //
- // Get the pixmap from the a resource file. If we fail in our attempt to create dogcowBitmapShape,
- // GXValidateShape will let us know via the debugger.
- //
- dogcowBitmapShape = GetPixMapShape( 128 );
- GXValidateShape ( dogcowBitmapShape );
-
- GXGetShapeBounds( dogcowBitmapShape, 0L, &patternBounds);
-
- //
- // Turn off all attributes used by our bitmap shape. By default, the gxMapTransformShape shape
- // attribute is set for bitmap shapes. We turn this off because we want the rotation to occur on
- // the geometry of our shape (i.e. the bits). This is required because the transform of the pattern's
- // shape is ignored once it has been added as a pattern shape. You can force the transform of the
- // pattern shape to be added to the shape by calling GXMapShape. This solves the previously described
- // problem, but the transform's clip is ignored when a shape is used as a pattern. We fix this problem below...
- //
- GXSetShapeAttributes( dogcowBitmapShape, gxNoAttributes );
-
- //
- // Here's part of the BUG, we want to fill the rectangle with a bitmap shape rotated 45 degrees. So, we
- // rotate it. Ths kinda of works, but the clip shape is lost by the bitmap shape once it is added to the
- // pattern record. This is bad, because the bitmap shape is only partially drawn correctly. The bottom
- // half of the shape looks like corregated steel....
- //
- #if !defined(kFixPatternRotationFill)
- GXRotateShape( dogcowBitmapShape, ff(45), 0, 0 );
- #endif
-
- #ifdef kDrawBitmapPattern
- GXDrawShape ( dogcowBitmapShape );
- #endif
-
- //
- // Set up the pattern record to allow our bitmap pattern shape be placed side by side.
- //
- thePattern.u.x = 0;
- thePattern.u.y = (patternBounds.bottom - patternBounds.top) ;
-
- #ifdef kFixPatternRotationFill
- thePattern.v.x = (patternBounds.right - patternBounds.left) ;
- thePattern.v.y = 0;
- thePattern.u.x = 0;
- #else
- PointToPolar( &thePattern.u, &toRotate );
- toRotate.angle += ff(45);
- PolarToPoint( &toRotate, &thePattern.u );
-
- thePattern.v.x = (patternBounds.right - patternBounds.left);
- thePattern.v.y = 0;
-
- PointToPolar( &thePattern.v, &toRotate );
- toRotate.angle += ff(45);
- PolarToPoint( &toRotate, &thePattern.v );
- #endif
-
- thePattern.attributes = gxNoAttributes;
- thePattern.pattern = dogcowBitmapShape;
-
- GXGetPictureParts( gThePage, 1, 1, &rectShapeFromPicture, nil, nil, nil );
- tempRectShape = GXCopyToShape ( nil, rectShapeFromPicture );
-
- GXSetShapePattern( tempRectShape, &thePattern );
-
- #ifdef kFixPatternRotationFill
- transformFromPicture = GXGetShapeTransform ( gThePage );
- invertedTransform = GXCopyToTransform( nil, transformFromPicture );
- GXGetTransformMapping( invertedTransform, &theMapping );
-
- GXSetShapeAttributes( tempRectShape, gxNoAttributes );
- GXSetShapeMapping( tempRectShape, &theMapping );
- RotateMapping( &theMapping, -ff(45), 0, 0 );
- GXMapShape( tempRectShape, &theMapping );
-
- InvertMapping( &theMapping, &theMapping );
- GXSetTransformMapping( invertedTransform, &theMapping );
-
- GXSetPictureParts( gThePage, 1, 1, 1, &tempRectShape, nil, nil, &invertedTransform );
-
- GXDisposeTransform( invertedTransform );
- #else
- GXSetPictureParts( gThePage, 1, 1, 1, &tempRectShape, nil, nil, nil );
- #endif
-
- #if !defined kDrawBitmapPattern
- GXDisposeShape( dogcowBitmapShape );
- #endif
-
- #ifdef kDisposeTheCopyOfRectangleShape
- GXDisposeShape( tempRectShape );
- #endif
- }
-
-
- /*------ DoDraw ---------------------------------------------------------------------------------------*/
- //
- // This function performs all of the drawing by calling GXDrawShape on our picture - gThePage.
- //
- void DoDraw( theWindow )
- WindowPtr theWindow;
- {
- GXDrawShape ( gThePage );
- }
-
-
- /*------ DoDispose -------------------------------------------------------------------------------------*/
- //
- // This function tosses all of the shapes and the window we have created.
- //
- void DoDispose( theWindow )
- WindowPtr theWindow;
- {
- //
- // You should always dispose of your QuickDraw GX objects before tossing your window. Why? It's generally good
- // form and this approach guarantees that everything is disposed. If you had not disposed of everything, the
- // call to DisposeWindow should dispose of the objects. If you are running the debugging version of the
- // "GXGraphics(debug)" extension with warnings enabled, you will receive a warning that you had not disposed of
- // everything when you app quits.
- //
- // Notices are enabled within the "graphics shell.c" automatically, if you have installed the debug
- // extension. We determine if the debug extension is installed by making the appropriate Gestalt call while the
- // graphics shell is starting up; see the "graphics shell.c" file for details.
- //
- GXDisposeShape( gThePage );
- GXDisposeShape( gWindowBoundsShape ); // This shape is created within "graphics shell.c" at start up...
- DisposeWindow( theWindow );
- }
-
-
-
- /*------ DoClick ---------------------------------------------------------------------------------------*/
- //
- // This function handles click by the user...
- //
- void DoClick( orgMouseLoc, theWindow )
- gxPoint orgMouseLoc;
- WindowPtr theWindow;
- {
- }
-
-
- /*------ DoIdle ----------------------------------------------------------------------------------------*/
- //
- // This function is called within the event loop when the "graphics shell" receives a null event...
- //
- void DoIdle(theWindow)
- WindowPtr theWindow;
- {
- }
-